#ifndef SM2_CRYPTO_H
#define SM2_CRYPTO_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>

extern int sm2_keypair_generate(EVP_PKEY **ppKeypair);
extern int sm2_encrypt(EVP_PKEY *pPublicKey, const unsigned char *pucId, size_t stIdLen, const unsigned char *pucPlaintext, size_t stPlaintextLen, unsigned char *pucCiphertext, size_t *pstCiphertextLen);
extern int sm2_decrypt(EVP_PKEY *pPrivateKey, const unsigned char *pucId, size_t stIdLen, const unsigned char *pucCiphertext, size_t stCiphertextLen, unsigned char *pucPlaintext, size_t *pstPlaintextLen);
extern int sm2_sign(EVP_PKEY *pPrivateKey, const unsigned char *pucId, size_t stIdLen, const unsigned char *pucMsg, size_t stMsgLen, unsigned char *pucSign, size_t *pstSignLen);
extern int sm2_verify(EVP_PKEY *pPublicKey, const unsigned char *pucId, size_t stIdLen, const unsigned char *pucMsg, size_t stMsgLen, const unsigned char *pucSign, size_t stSignLen);

#ifdef __cplusplus
}
#endif

#endif